<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/3/1
  Time: 11:59
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script src="../js/jquery-3.4.1.min.js" language="JavaScript"></script>
    <script language="JavaScript">
        $(function () {
            $.get("/getGrade",null,function (www) {
                for (var i=0;i<www.length;i++){
                    var option=$("<option value="+www[i].gid+">"+www[i].gname+"</option>");
                    $("#gid").append(option);
                }
            },"json");
        });
    </script>
</head>
<body>
添加学生
<form id="form1" name="form1" method="post" action="/addStudent">
    <p>学号:
        <input type="text" name="xh" id="ss"  />
    </p>
    <p>姓名:
        <input type="text" name="name" id="textfield" />
    </p>
    <p>年龄:
        <input type="text" name="age" id="textfield2" />
    </p>
    <p>性别:
        <input name="sex" type="radio" id="radio" value="男" checked="checked" />
        男
        <input type="radio" name="sex" id="radio2" value="女" />
        女
    </p>
    <p>生日:
        <input type="date" name="birthday">
    </p>
    <p>地址:
        <input type="text" name="address" id="textfield4" />
    </p>
    <p>状态:
        <input type="text" name="state" id="textfield5" />
    </p>
    <p>年级:
        <%--<input type="text" name="gid" id="textfield6" />--%>
        <select id="gid" name="gid"></select>


        下拉列表，从数据库中查询年级
    </p>
    <p>
        <input type="submit" name="button" id="button" value="添加" />
    </p>
</form>
</body>
</html>
